<!-- Network interface partial -->
<script id="network_interface.partial" type="text/x-handlebars-template" xmlns="http://www.w3.org/1999/html">
  <div class="accordion">
      <h5 class="list-group-item-heading accordion-heading"><samp>{{@key}}</samp>
          <a class="accordion-toggle collapsed" data-toggle="collapse" href="#{{escape_dots (concat 'ec2.regions' region 'vpcs' vpc 'instances' instance_id 'network_interfaces' network_interface)}}">
              <span class="badge float-right btn-info">Details</span>
          </a>
      </h5>
      <div id="{{concat 'ec2.regions' region 'vpcs' vpc 'instances' instance_id 'network_interfaces' network_interface}}" class="accordion-body item-margin collapse">
          <div class="accordion-inner">
              <ul>
                  {{#if Description}}<li class="list-group-item-text no-margin">Description: {{Description}}</li>{{/if}}
                      {{#if Association}}
                          <li class="list-group-item-text no-margin">Public IP: <samp>{{Association.PublicIp}}</samp></li>
                  {{#if Association.PublicDnsName}}<li class="list-group-item-text no-margin">Public DNS: <samp>{{Association.PublicDnsName}}</samp></li>{{/if}}
                  {{/if}}
                  {{#if Attachment}}
                  <li class="list-group-item-text no-margin">Attached to Instance: <samp>{{Attachment.InstanceId}}</samp></li>
                  {{/if}}
                  {{#if Ipv6Addresses}}
                      <li class="list-group-item-text no-margin">IPv6 Addresses:</li>
                      <ul>
                          {{#each Ipv6Addresses}}
                          <li class="list-group-item-text"><samp>{{Ipv6Address}}</samp></li>
                          {{/each}}
                      </ul>
                  {{/if}}
                  {{#each PrivateIpAddresses}}
                  <li class="list-group-item-text no-margin">{{#if Primary}}Primary {{/if}}Private IP: <samp>{{PrivateIpAddress}}</samp></li>
                  {{/each}}
                  <li class="list-group-item-text no-margin">Security Groups:
                      <ul>
                          {{#each Groups}}
                              <li><a href="javascript:showObject('services.ec2.regions.{{../region}}.vpcs.{{../vpc}}.security_groups.{{GroupId}}')">{{GroupName}}</a></li>
                          {{/each}}
                      </ul>
                  </li>
              </ul>
          </div>
      </div>
  </div>
</script>

<script>
  Handlebars.registerPartial("network_interface", $("#network_interface\\.partial").html());
</script>

<!-- Single instance template -->
<script id="single_network_interface-template" type="text/x-handlebars-template">
    {{> modal-template template='network_interface' name=network_interface}}
</script>

<script>
  var single_ec2_network_interface_template = Handlebars.compile($("#single_network_interface-template").html());
</script>